<?php $this->layout = 'admin'; ?>
<?php if ($admin == 1) { ?>


    <?php $this->start('leftmenu'); ?>
    <div class="well pull-left">
        <ul class="nav nav-list">
            <li><?php echo $this->Html->link('Add User', array('controller' => 'Users', 'action' => 'add')); ?></li>
        </ul>
    </div>
    <?php $this->end(); ?>
<?php } ?>

<html>
    <h2>Delete User</h2>
    <body>
        <?php if ($admin == 1) { ?>
            <table width="100" height="66" >
                <tr>
                    <th>Image</th>
                    <th>Name</th>
                    <th>Actions</th>

                    <?php while ($l > 0) { ?>
                    <tr>
                        <?php if ($usersArray[$length - $l]['User']['image'] == Null) { ?>
                            <td width = "15"><center><?php echo $this->Html->image("http://t1.gstatic.com/images?q=tbn:ANd9GcTr3oSt5svbIyNCUApImRgyohGDOpRbmirAPwS1QjtZZgZOyCbWW80zT9Fx", array('width' => '50px', 'height' => '50px')) ?></center></td>
                <?php } else { ?>
                    <td width = "15"><center><?php echo $this->Html->image($usersArray[$length - $l]['User']['image'], array('width' => '50px', 'height' => '50px')) ?></center></td>
            <?php } ?>    
            <td width="214"><?php echo $usersArray[$length - $l]['User']['username'] ?></td> 
            <td width="56"><?php echo $this->Html->link('Delete', array('action' => 'delete1', $usersArray[$length - $l]['User']['userID']), array(), "Are you sure you wish to delete this user ?") ?></td>
        </tr>
        <?php $l--;
    } ?>

    </table>
<?php } ?>
<h2>Reactivate Deleted User</h2>
<body>
<?php if ($admin == 1) { ?>
        <table width="111" height="44" >
            <tr>
                <th>Image</th>
                <th>Name</th>
                <th>Actions</th>

    <?php while ($deletedl > 0) { ?>
                <tr>
                    <?php if ($deletedusersArray[$deletedlength - $deletedl]['User']['image'] == Null) { ?>
                            <td width = "15"><center><?php echo $this->Html->image("http://t3.gstatic.com/images?q=tbn:ANd9GcRB_SnpXS1TBeIPG4W_RJ9s3RgVW3zGfWN9B7BGQUEDNmIcST5CzzkSgy--", array('width' => '50px', 'height' => '50px')) ?></center></td>
                <?php } else { ?>
                    <td width = "15"><center><?php echo $this->Html->image($deletedusersArray[$deletedlength - $deletedl]['User']['image'], array('width' => '50px', 'height' => '50px')) ?></center></td>
                            <?php } ?>
        <td width="214"><?php echo $deletedusersArray[$deletedlength - $deletedl]['User']['username'] ?></td>
            <td width="56"><?php echo $this->Html->link('Reactivate', array('action' => 'restore1', $deletedusersArray[$deletedlength - $deletedl]['User']['userID']), array(), "Are you sure you wish to reactivate this user ?") ?></td>
        </tr>
        <?php $deletedl--;
    } ?>

    </table>
<?php } ?>
</html>